package org.shagin.jfin.saf;

import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
import org.shagin.jfin.core.ui.UIUtils;
import org.shagin.jfin.ui.JMainFrame;

/**
 * The Class JFinApplication.
 */
public class JFinApplication extends SingleFrameApplication {

    private JMainFrame mainFrame;

    /**
     * {@inheritDoc}
     */
    @Override
    protected void startup() {
        mainFrame = JMainFrame.getInstance();
        setMainFrame(mainFrame);
        UIUtils.centerScreen(mainFrame);
        mainFrame.setVisible(true);
    }

    /**
     * Gets the single instance of JFinApplication.
     *
     * @return single instance of JFinApplication
     */
    public static synchronized JFinApplication getInstance() {
        return (JFinApplication) Application.getInstance();
    }

}
